<?php

declare (strict_types=1);

namespace magein\think\pay;

use magein\pay\PayConfig;
use magein\pay\Payment;
use think\Service;

class PayService extends Service
{
    /**
     * 注册服务
     *
     * @return void
     */
    public function register()
    {
        $this->app->bind('payment', Payment::class);
    }

    /**
     * 执行服务
     *
     * @return void
     */
    public function boot()
    {
        PayConfig::instance()->setConfig(config('pay'));

        // 注册路由
        $this->loadRoutesFrom(__DIR__ . '/route.php');
    }
}